/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "rolemaster")
@XmlRootElement(name  = "rolemaster")
@NamedQueries({
    @NamedQuery(name = "Rolemaster.findAll", query = "SELECT r FROM Rolemaster r"),
    @NamedQuery(name = "Rolemaster.findByRoleID", query = "SELECT r FROM Rolemaster r WHERE r.roleID = :roleID"),
    @NamedQuery(name = "Rolemaster.findByRolename", query = "SELECT r FROM Rolemaster r WHERE r.rolename = :rolename"),
    @NamedQuery(name = "Rolemaster.findByYear", query = "SELECT r FROM Rolemaster r WHERE r.year = :year"),
    @NamedQuery(name = "Rolemaster.findByDescription", query = "SELECT r FROM Rolemaster r WHERE r.description = :description"),
    @NamedQuery(name = "Rolemaster.findBySquencenumber", query = "SELECT r FROM Rolemaster r WHERE r.squencenumber = :squencenumber"),
    @NamedQuery(name = "Rolemaster.findByCreateddate", query = "SELECT r FROM Rolemaster r WHERE r.createddate = :createddate"),
    @NamedQuery(name = "Rolemaster.findByDeleteddate", query = "SELECT r FROM Rolemaster r WHERE r.deleteddate = :deleteddate"),
    @NamedQuery(name = "Rolemaster.findByLastupdation", query = "SELECT r FROM Rolemaster r WHERE r.lastupdation = :lastupdation"),
    @NamedQuery(name = "Rolemaster.findByIsdeleted", query = "SELECT r FROM Rolemaster r WHERE r.isdeleted = :isdeleted")})
public class Rolemaster implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "RoleID")
    private Long roleID;
    @Column(name = "rolename")
    private String rolename;
    @Column(name = "year")
    @Temporal(TemporalType.DATE)
    private Date year;
    @Column(name = "description")
    private String description;
    @Column(name = "squencenumber")
    private Integer squencenumber;
    @Column(name = "createddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createddate;
    @Column(name = "deleteddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date deleteddate;
    @Column(name = "lastupdation")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastupdation;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "employee_EmployeeID_deletedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee;
    @JoinColumn(name = "employee_EmployeeID_updatedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee1;

    public Rolemaster() {
    }

    public Rolemaster(Long roleID) {
        this.roleID = roleID;
    }

    public Long getRoleID() {
        return roleID;
    }

    public void setRoleID(Long roleID) {
        this.roleID = roleID;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public Date getYear() {
        return year;
    }

    public void setYear(Date year) {
        this.year = year;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getSquencenumber() {
        return squencenumber;
    }

    public void setSquencenumber(Integer squencenumber) {
        this.squencenumber = squencenumber;
    }

    public Date getCreateddate() {
        return createddate;
    }

    public void setCreateddate(Date createddate) {
        this.createddate = createddate;
    }

    public Date getDeleteddate() {
        return deleteddate;
    }

    public void setDeleteddate(Date deleteddate) {
        this.deleteddate = deleteddate;
    }

    public Date getLastupdation() {
        return lastupdation;
    }

    public void setLastupdation(Date lastupdation) {
        this.lastupdation = lastupdation;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public Employee getEmployee1() {
        return employee1;
    }

    public void setEmployee1(Employee employee1) {
        this.employee1 = employee1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (roleID != null ? roleID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rolemaster)) {
            return false;
        }
        Rolemaster other = (Rolemaster) object;
        if ((this.roleID == null && other.roleID != null) || (this.roleID != null && !this.roleID.equals(other.roleID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Rolemaster[roleID=" + roleID + "]";
    }

}
